/**
 * @ClassName: indexEcharts
 * @Description: // 首页echarts配置
 * @Author: Ellwood
 * @CreateDate: 2024/8/19 - 下午5:22
 * @Version: V1.0.0
 */

/**
 * 柱状图
 */
const echart1={
    legend: {},
    tooltip: { },
    dataset: {
       // radius: '70%',
        dimensions: ['product', '2015', '2016', '2017'],
        source: [
            { product: 'Matcha Latte', 2015: 43.3, 2016: 85.8, 2017: 93.7 },
            { product: 'Milk Tea', 2015: 83.1, 2016: 73.4, 2017: 55.1 },
            { product: 'Cheese Cocoa', 2015: 86.4, 2016: 65.2, 2017: 82.5 },
            { product: 'Walnut Brownie', 2015: 72.4, 2016: 53.9, 2017: 39.1 }
        ]
    },
    xAxis: {
        type: 'category',
    },
    yAxis: { },
    series: [
        { type: 'bar', name: '2015', itemStyle: { color: '#73C0DE' } }, // 自定义颜色
        { type: 'bar', name: '2016', itemStyle: { color: '#5470C6' } },
        { type: 'bar', name: '2017', itemStyle: { color: '#91CC75' } }
    ]
}

/**
 * 折线图
 */
const echart2={
    title: {
        text: ''
    },
    tooltip: {
    },
    legend: {
        data: [ 'Video Ads', 'Direct', 'Search Engine']
    },
    toolbox: {
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [
        {
            type: 'category',
            boundaryGap: false,
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        }
    ],
    yAxis: [
        {
            type: 'value'
        }
    ],
    series: [
        {
            name: 'Video Ads',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series'
            },
            data: [150, 232, 201, 154, 190, 330, 410]
        },
        {
            name: 'Direct',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series'
            },
            data: [320, 332, 301, 334, 390, 330, 320]
        },
        {
            name: 'Search Engine',
            type: 'line',
            stack: 'Total',
            label: {
                show: true,
                position: 'top'
            },
            areaStyle: {},
            emphasis: {
                focus: 'series'
            },
            data: [820, 932, 901, 934, 1290, 1330, 1320]
        }
    ]
}

/**
 * 雷达图
 */
const echart3={
    title: {
        text: ''
    },
    legend: {
        data: ['已分配预算', '实际支出'],
        z:10,
        right:'right',

    },
    radar: {
        radius: '70%',
        splitNumber: 5, // 根据需要调整分割数
        // shape: 'circle',
        indicator: [
            { name: '销售额',min: 0, max: 6500 },
            { name: '管理',min: 0, max: 16000 },
            { name: '信息技术',min: 0, max: 30000 },
            { name: '客户支持',min: 0, max: 38000 },
            { name: '发展',min: 0, max: 52000 },
            { name: '营销',min: 0, max: 25000 }
        ]
    },
    grid:{
        containLabel: true // 确保标签在网格区域内
    },
    series: [
        {
            type: 'radar',
            data: [
                {
                    value: [4200, 3000, 20000, 35000, 50000, 18000],
                    name: '已分配预算'
                },
                {
                    value: [5000, 14000, 28000, 26000, 42000, 21000],
                    name: '实际支出',
                }
            ],
        }
    ]
}

export {
    echart1,echart2,echart3
}